import request from '@/utils/request'

//注册register
export const register = ({name,email,password,code}) => {
  return request.post('auth/register',{name,email,password,code})
}

//登录
export const login = ({email,password}) => {
  return request.post('auth/login',{email,password})
}

//获取用户信息
export const getUserInfo = () => {
  return request.get('auth/userInfo')
}

//获取其他用户信息
export function getUserInfoById(uid){
  return request.get('userInfo?uid='+uid)
}

//修改信息
export const modifyInfo = ({name,sign}) => {
  return request.post('auth/modifyInfo',{name,sign})
}

//获取验证码
export const sendCode = (email) => {
  return request.post('code/send',{email})
}
